#include "CompetencePourcent.h"

using namespace std;

const ScoreAdditionnel CompetencePourcent::SANormal( Aucun );

CompetencePourcent::CompetencePourcent( const string& nom,
					const unsigned& prix,
					const unsigned& valeurBase )
  : CompetenceClasseBase( "CompetencePourcent", nom, "", prix ),
    ValeurBase( valeurBase )
{}

CompetencePourcent::CompetencePourcent( const string& nom,
					const string& alias,
					const unsigned& prix,
					const unsigned& valeurBase )
  : CompetenceClasseBase( "CompetencePourcent", nom, alias, prix ),
    ValeurBase( valeurBase )
{}

CompetencePourcent::CompetencePourcent( const CompetencePourcent& compPourcent )
  : CompetenceClasseBase( compPourcent ),
    ValeurBase( compPourcent.valeurBase() )
{}

CompetencePourcent::~CompetencePourcent()
{}

const ScoreAdditionnel& CompetencePourcent::autreScore() const
{
  return SANormal;
}

const bool& CompetencePourcent::pourcentage() const
{
  return BoolTrue;
}

const unsigned& CompetencePourcent::valeurBase() const
{
  return ValeurBase;
}

void CompetencePourcent::afficherInstance( ostream& os ) const
{
  os << nom();
  if ( aliasDefini() )
    os << " (alias " << aliasNom() << ")";
  os << ", coût " << prix();
  os << " (associé à un pourcentage, valeur de base " << valeurBase() << ")";
}

void CompetencePourcent::afficherInstance( FlotMessage& flot ) const
{
  flot << nom();
  if ( aliasDefini() )
    flot << " (alias " << aliasNom() << ")";
  flot << ", coût " << prix();
  flot << " (associé à un pourcentage, valeur de base " << valeurBase() << ")";
}

CompetenceClasseBase * CompetencePourcent::creerCopie() const
{
  return new CompetencePourcent( *this );
}
